#{extends 'main.html' /}
#{set title: 'page.app.home.title' /}

<div id="content">
#{ifnot focus?.id}
	<h3>New focus</h3>
#{/ifnot}
#{else}
	<h3>Edit the focus</h3>
#{/else}

#{ifErrors}
<p class="error">
Please correct these errors.
</p>
#{/ifErrors}

#{form @bluehat.FocusController.save(), method:'POST', id:'focusForm'}
#{field 'focus.id'}
  <input type="hidden" id="${field.id}" name="${field.name}" value="${focus?.id}" class="${field.errorClass}">
#{/}
#{field 'focus.title'}
<p>
  <label for="${field.id}">&{field.name}</label>
  <input type="text" id="${field.id}" name="${field.name}" value="${focus?.title}" class="${field.errorClass}">
  <span class="error">${field.error}</span>
</p>
#{/}
#{field 'focus.description'}
<p>
  <label for="${field.id}">&{field.name}</label>
  <textarea id="${field.id}" name="${field.name}" cols="10" rows="3" class="${field.errorClass}">${focus?.description}</textarea>
  <span class="error">${field.error}</span>
</p>
#{/}
<input type="submit"></input>
#{/form}

<a href="@{bluehat.DashBoard.index()}">Volver a la lista de focos</a>
</div>
